<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>发布资料</title>

        <link rel="stylesheet" type="text/css" href="/public/design/css/niceEdit.css"/>
        <link rel="stylesheet" type="text/css" href="/public/design/css/styles.css"/>
        <link rel="stylesheet" type="text/css" href="/public/design/compose.css"/>
    </head>
    <body>

        <div id="container">
            #{include '_nav.html'/}
            <div id="center">
                <div class="left">
                    <form action="@{B.post}" method="post"  enctype="multipart/form-data" id="compose">
                        <div id="top">
                            <div class="btn">
                                <input type="button" value="存为草稿" />
                                <input type="button"  value="预览" />
                                <input type="submit" id="fabu" value="发布" />
                            </div>
                        </div>

                        <table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td class="bt">标题</td>
                                <td><input type="text" name="subject" id="title" value="" class="c" /></td>
                                <td class="bt">作者</td>
                                <td><input type="text" name="author" id="author" value="" class="d"/></td>
                            </tr>
                            <tr>
                                <td class="bt">分类</td>
                                <td><input type="text" name="tags" id="search" placeholder="输入问题分类，让更多专业的人发现。" class="c"/></td>
                            </tr>
                            <tr>
                                <td class="bt">主图</td>
                                <td colspan="3"><input type="file" name="files" class="img"/></td>
                            </tr>
                            <tr>
                                <td class="bt">简介</td>
                                <td colspan="3"><textarea name="summary" style="height: 40px"></textarea></td>
                            </tr>
                            <tr>
                                <td class="bt">正文</td>
                                <td colspan="3"><textarea nic="nic" name="content" placeholder="输入..." class="content"></textarea></td>
                            </tr>

                        </table>
                    </form>
                </div>
                <div class="right">
                    <div class="img">
                        <img src="/public/design/img/fabuziliao/zhanshi.png"/>
                    </div>
                    <ul class="out">
                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/dongTai/caogao.png"/></li>
                                <li class="text">我的草稿</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/ziLiao/u13.png"/></li>
                                <li class="text">我的收藏</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/dongTai/guanzhu.png"/></li>
                                <li class="text">我的关注</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/dongTai/fabu.png"/></li>
                                <li class="text">我发布的帖子</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/dongTai/pinglun.png"/></li>
                                <li class="text">我评论的帖子</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/fabuziliao/zl.png"/></li>
                                <li class="text">我发布的资料</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/design/img/fabuziliao/xiug.png"/></li>
                                <li class="text">我评论的资料</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                    </ul>
                </div>
            </div>
            #{include '_footer.html'/}
        </div>
        <script src="/public/design/js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/javascripts/nicEdit.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/design/js/jquery.autocomplete.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" src="/public/javascripts/jquery.form.min.js" ></script>
        <script type="text/javascript" src="/public/javascripts/xjp.js" ></script>

        <script type="text/javascript">
            $(function () {
                $('#compose').ajaxForm({
                    beforeSerialize: function () {
                        var cnt = $("textarea[nic=nic]").parent();
                        var html = cnt.find('.nicEdit-main').html();
                        $("textarea[nic=nic]").html(html);
                    }
                });
                bkLib.onDomLoaded(function () {
                    nicEditors.allTextAreas();
                });

                $("#autocomplete").focus(function () {
                    $(this).val("");
                }).blur(function () {
                    if ($(this).val() == "") {
                        $(this).val("输入问题分类，让更多专业的人发现。");
                    }
                })

                $("textarea[nin=nic]").focus(function () {
                    $(this).val("");
                });

                $(".back").click(function () {
                    window.close();
                });

                //及时搜索
                var countries = [
                    {value: '分类:室内', data: '室内'},
                    {value: '室内设计', data: ''},
                    {value: '室内装修', data: '室内'},
                    {value: '室内环保', data: '室内'},
                    {value: '室内设计', data: '室内'},
                    {value: '室内设计', data: '室内'},
                    {value: '话题:室内', data: '室内'},
                    {value: '某宾馆室内设计', data: '室内'},
                    {value: '某大厦室内设计', data: '室内'},
                    {value: '资料:室内', data: '室内'},
                    {value: '某宾馆室内设计', data: '室内'},
                    {value: '某大厦室内设计', data: '室内'},
                    {value: '某宾馆室内设计', data: '室内'},
                    {value: '某大厦室内设计', data: '室内'},
                    {value: '更多室内相关资料...', data: '室内'},
                    // ...
                    {value: 'Zimbabwe', data: 'ZZ'}
                ];

                $('#autocomplete').autocomplete({
                    lookup: countries,
                    onSelect: function (suggestion) {
                        alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
                        /*  window.open("souSuojieguo.html");*/
                    },
                    autoFill: true,
                });
                $(".userinfo").hover(function () {
                    $(".info").slideDown("fast");
                }, function () {
                    $(".info").slideUp("10");
                })
                $('#search').autocomplete({
                    lookup: countries,
                    onSelect: function (suggestion) {
                        alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
                        /*  window.open("souSuojieguo.html");*/
                    },
                    autoFill: true,
                });

            })
        </script>
    </body>
</html>

